package com.hotleproject.controller;

import com.hotleproject.pojo.Order;
import com.hotleproject.service.InsertOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

@Controller
@RequestMapping("/users")
public class InsertOrderController {
    @Autowired
    private InsertOrderService insertOrderService;
    @RequestMapping("/insertOrder")
    public String insertOrder(Order order, HttpServletRequest request, Model model){
//        model.addAttribute("hotlename",request.getParameter("hotlename"));
//        model.addAttribute("liveIn",request.getParameter("liveIn"));
//        model.addAttribute("liveOut",request.getParameter("liveOut"));
//        model.addAttribute("phone",request.getParameter("phone"));
//        model.addAttribute("roomPrice",request.getParameter("roomPrice"));
//        model.addAttribute("roomType",request.getParameter("roomType"));
        this.insertOrderService.addOrder(order);
        return "HotleMain.html";
    }
}
